{% extends 'layout.html' %}

{% block content %}
    <form class="form-signin" method="post" action="">
    {% if validlink %}
        {% csrf_token %}
        <h1 class="h3 mb-3 font-weight-normal">Reset password</h1>

        
        {{form.new_password1.errors}}
        {{form.new_password2.errors}}
        <div class='field'>
            <input type="password" name='new_password1' id="inputPassword1" placeholder="" required>
            <label for="inputPassword1">Password</label>
        </div>
        <div class='field'>
            <small id="passwordHelpBlock" class="form-text text-muted">
                Your password must be at least 8 characters long and must contain at least 1 lowercase letter, 1 uppercase letter, and 1 digit. We strongly recommend at least 1 special character as well.
            </small>
            <input
                pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[!-~]{8,}$" type="password" name='new_password2'
                id="inputPassword1" placeholder="" required
            >
            <label for="inputPassword1">Password (again)</label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">Reset password</button>
    {% else %}
        <p class='text-danger'>This password reset link has expired. Please <a href='/accounts/password_reset/'>request a new one</a>.
    {% endif %}
    </form>
{% endblock %}
